package com.sec.android.app.myfiles.module.local.home;

import android.content.Context;

import com.sec.android.app.myfiles.facade.FacadeItem;
import com.sec.android.app.myfiles.fragment.AbsMyFilesFragment;
import com.sec.android.app.myfiles.fragment.home.HomeFragment;
import com.sec.android.app.myfiles.fragment.home.HomeFragmentItem;
import com.sec.android.app.myfiles.module.ContentObservable;
import com.sec.android.app.myfiles.module.abstraction.AbsContentObserverImp;
import com.sec.android.app.myfiles.module.abstraction.AbsDragAndDrop;
import com.sec.android.app.myfiles.module.abstraction.AbsFileListAdapterImp;
import com.sec.android.app.myfiles.module.abstraction.AbsFileOperationImp;
import com.sec.android.app.myfiles.module.abstraction.AbsMenuImp;
import com.sec.android.app.myfiles.module.abstraction.AbsModuleLoaderImp;
import com.sec.android.app.myfiles.module.abstraction.AbsProviderImp;
import com.sec.android.app.myfiles.module.abstraction.AbsReloadStrategyImp;
import com.sec.android.app.myfiles.module.abstraction.FileRecord;
import com.sec.android.app.myfiles.module.abstraction.FileRecord.StorageType;
import com.sec.android.app.myfiles.navigation.NavigationInfo;
import com.sec.android.app.myfiles.operation.ProgressListener;
import com.sec.android.app.myfiles.provider.DbTableInfo;
import com.sec.android.app.myfiles.widget.listview.AbsListViewImp;

import java.util.ArrayList;

public class HomeModuleLoaderImp extends AbsModuleLoaderImp {
    @Override
    protected StorageType getSupportStorage() {
        return StorageType.Home;
    }

    @Override
    protected FileRecord _createFileRecord(String fullPath) {
        return new HomeFileRecord();
    }

    @Override
    protected FileRecord _createFileRecord(int id, String path, String name, long size, long date, int fileType, int isHidden, int itemCount,
                                           int itemCountHidden) {
        return new HomeFileRecord(id, path, name, size, date, fileType, isHidden, itemCount, itemCountHidden);
    }

    @Override
    public AbsFileListAdapterImp _createAdapterImp(Context context, NavigationInfo navigationInfo, AbsListViewImp listView) {
        //Do nothing in Home
        return null;
    }

    @Override
    public AbsProviderImp _createProviderImp(Context context) {
        //Do nothing in Home
        return null;
    }

    @Override
    public DbTableInfo _getTableInfoImp() {
        //Do nothing in Home
        return null;
    }

    @Override
    public AbsMenuImp _createMenuImp(Context context, StorageType supportStorage) {
        AbsMenuImp ret = new HomeMenuImp(context, supportStorage);
        return ret;
    }

    @Override
    protected AbsFileOperationImp _createFileOperationImp(Context context, ProgressListener listener) {
        //Do nothing in Home
        return null;
    }

    @Override
    protected void _createHomeItem(Context context, HomeFragment fragment, ArrayList<HomeFragmentItem> itemList, boolean isLeftPanel) {
        //Do nothing in Home
    }

    @Override
    protected void _addFacadeItemList(ArrayList<FacadeItem> facadeItem) {
        //Do nothing in Home
    }

    @Override
    protected AbsContentObserverImp _createContentObserver(Context context, FileRecord record, ContentObservable updater) {
        //Do nothing in Home
        return null;
    }

    @Override
    protected AbsReloadStrategyImp _createReloadStrategy(Context context, NavigationInfo navigationInfo) {
        //Do nothing in Home
        return null;
    }

    @Override
    protected AbsDragAndDrop _getDragAndDropImp(AbsMyFilesFragment fragment, AbsListViewImp listViewImp) {
        return new HomeDragAndDropImp(fragment, listViewImp);
    }
}
